<?php

namespace Yolo\Captcha\Core;

use Yolo\Captcha\Core\Engines\CaptchaInterface;
use Yolo\Captcha\Core\Engines\Character;
use Yolo\Captcha\Core\Engines\SimpleArithmetic;

class CaptchaFactory
{

    /**
     * @param CaptchaEngine $engine
     * @return CaptchaInterface
     */
    public static function getFactory(CaptchaEngine $engine): CaptchaInterface
    {
        return match ($engine) {
            CaptchaEngine::SIMPLE_ARITHMETIC => new SimpleArithmetic(),
            default => new Character(),
        };
    }
}
